Skip to content

Conversation

chriscasola
Copy link
Contributor

When you specify a method on a component with the same name as a prop you get an error about mutating a prop directly, but it can be hard for people new to vue to figure out what this means.

This PR adds a more explicit warning message indicating exactly what went wrong.

@rohmanhm
Copy link
Contributor

That's was great 👍🏼

}
if (props && hasOwn(props, key)) {
warn(
`method "${key}" has already been defined as a property value.`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simply say as a prop it's clearer and already in other warnings 🙂

@chriscasola
Copy link
Contributor Author

@posva thanks for the feedback. Updated.

@yyx990803 yyx990803 merged commit 3dc9338 into vuejs:dev Feb 18, 2017
@yyx990803
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants